package com.sky.admin.api.vo;


import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serial;
import java.io.Serializable;
import lombok.Data;

/**
 * 业务返参对象
 */
@Data
@Schema(name = "文件上传业务返回对象")
public class ObsResultVo implements Serializable {

	@Serial
	private static final long serialVersionUID = 1L;

	@Schema(name = "文件id")
	private Integer fileId;

	@Schema(name = "存储相对路径")
	private String link;

	@Schema(name = "存储绝对路径（可直接访问），特殊业务，此字段为空")
	private String openLink;

	public static ObsResultVo ok(Integer fileId, String link, String openLink) {
		return restResult(fileId, link, openLink);
	}

	private static ObsResultVo restResult(Integer fileId, String link, String openLink) {
		ObsResultVo apiResult = new ObsResultVo();
		apiResult.setFileId(fileId);
		apiResult.setLink(link);
		apiResult.setOpenLink(openLink);
		return apiResult;
	}
}
